feat(env_filter): support no_std#404
Conversation
Co-authored-by: WolverinDEV <git@did.science>
|
FYI I expect PRs to be presented for how they should be reviewed and merged and not for how they were developed. Please clean up the commit history |
b754c66 to
364726a
Compare
|
@epage, could you take another look at the PR? |
| #[cfg(not(feature = "std"))] | ||
| log::warn!("{error}, ignoring it"); |
There was a problem hiding this comment.
This is for creating the logger in the first place, so I don't think it is too meaningful to log at this point.
There was a problem hiding this comment.
At least in my use case, the filter member of the logger is a OnceCell<env_filter::Filter> and until the filter is fully initialised, the logger is returned a Option<&Filter>::None when trying to get it. When it receives the None, it simply lets the log message through, so the user is able to see the warning.
364726a to
2a7ae94
Compare
Co-authored-by: WolverinDEV <git@did.science>
2a7ae94 to
8e062c3
Compare
|
In the latest force-push, in addition to what was raised in the review, I fixed an error I made related to the handling of the features of the |
Based on #378, this PR adds a new default feature
stdthat allows the crate to be used in no_std crates. I tried to incorporate the feedback that was given to the previous PR. Hopefully, I didn't miss anything.The PR is still a breaking change for crates that have the default features disabled and use
Builder::from_env, or expectBuilder::parseto print warnings to stderr and don't have the log target set to stderr.It may make sense to squash 9c70eaf and 663c9c2 (and potentially b754c66). I kept them separate to make sure I don't misattribute the work of the author of the base PR.